<!DOCTYPE html>
<html lang="en" ng-app="">
<head>
    <meta charset="UTF-8">
    <title>Angular表达式</title>
    <script src="js/angular-1.3.0.js"></script>
</head>
<body>
    <div ng-controller="contr">
        执行JavaScript表达式<br>
        <input type="text" ng-model="m">
        <button ng-click="m1(m)">计算</button>
        <br><br>
        执行Angular表达式：<br>
        <input type="text" ng-model="n">
        <span ng-bind="$eval(n)"></span>
        <!--
            $eval():对绑定的属性值进行解析
        -->
    </div>
    <script tyte="text/javascript">
        function contr($scope){
            $scope.m = 20;
            $scope.n = "20 + 1 | number : 0";
            $scope.m1 = function(e){
                var newvalue = parseInt(e) + 1;
                console.log(newvalue);
            }
        }
    </script>
</body>
</html>